//
//  UIViewHelper.m
//  VidoarDemo
//
//  Created by xm on 2025/7/29.
//

#import "UIViewHelper.h"

@implementation UIViewHelper




+(UIButton*) createButtonWithTitle:(NSString*)title frame:(CGRect) frame
{
    UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:title forState:UIControlStateNormal];
    button.top = frame.origin.y;
    button.left = frame.origin.x;
    button.width = frame.size.width;
    button.height = frame.size.height;
    
    button.layer.cornerRadius = 5;
    button.layer.masksToBounds = YES;
    button.titleLabel.textAlignment = NSTextAlignmentCenter;
    [button setTitleColor:[UIColor colorWithHexString:@"FFFFFF"] forState:UIControlStateNormal];
    [button.titleLabel setFont:[UIFont systemFontOfSize:20]];
    [button setBackgroundColor:[UIColor colorWithHexString:@"5974A4"]];
    
    return button;
}

+(UILabel*) createLabelWithText:(NSString*)text frame:(CGRect) frame fontSize:(CGFloat)fontSize
{
    UILabel* lb = [[UILabel alloc] init];
    lb.top = frame.origin.y;
    lb.left = frame.origin.x;
    lb.width = frame.size.width;
    lb.height = frame.size.height;
    lb.font = [UIFont systemFontOfSize:fontSize];
    lb.numberOfLines = 0;
    lb.textAlignment = NSTextAlignmentLeft;
    lb.text = text;
    
    return lb;
}


@end
